The present invention generally relates to a detecting apparatus, and more particularly, to a contour line characteristic point detecting apparatus for detecting an object by obtaining linear components and corners from contour line tracing data of an image in which edges of the object are represented by lines, in the case where position, attitude, and configuration, etc. of the object are to be found through processing of images picked up by a television camera and the like as in a so-called "robot-vision".
In recent years, the contour line characteristic point detecting method as referred to above has been widely employed for the "robot-vision", "machine-vision" or the like as an effective method for detecting an object.
Hereinbelow, referring to FIGS. 3 and 4, one example of the conventional contour line characteristic point detecting method as stated above will be explained.
FIG. 3 shows a contour line L of a binary image, a line image obtained by an edge detection or the like. For respective picture elements constituting such a contour line L, tracing numbers are written for convenience of explanation. Meanwhile, FIG. 4 shows direction code numbers to be used in the explanation. In other words, FIG. 4 shows directions of subsequent tracing picture elements in the picture elements to which attention is directed i.e. in the noticed picture elements, and at each 45.degree. in the clockwise direction, with a horizontal leftward direction being set as 0, directions are indicated by numbers from 0 to 7. Table 1 given below represents steps for extracting linear portions by processing the contour lines shown in FIG. 3.
TABLE 1 ______________________________________ (a) Tracing No. 1 2 3 4 5 6 7 ______________________________________ (b) Direction 5 4 4 5 4 4 5 code (c) Smoothing -- -- 22 21 22 22 21 code (d) Average value -- -- 22 21.5 21.67 21.75 21.6 (e) Average value -- -- 0 1 0.5 0.33 0.75 difference (Absolute value) (f) Linear label -- -- 1 1 1 1 1 No. ______________________________________ (a) 8 9 10 11 12 13 14 15 ______________________________________ (b) 4 4 5 4 4 5 6 6 (c) 22 22 21 22 24 25 28 30 (d) 21.67 21.71 21.63 21.67 24 24.5 28 30 (e) 0.4 0.33 0.71 0.37 2.33 1 3.5 2 (f) 1 1 1 1 2 2 3 4 ______________________________________ (a) 16 17 18 19 20 21 22 23 ______________________________________ (b) 7 6 6 7 6 6 7 6 (c) 31 32 32 32 32 32 31 32 (d) 30.5 32 32 32 32 32 31.83 31.86 (e) 1 1.5 0 0 0 0 1 0.17 (f) 4 5 5 5 5 5 5 5 ______________________________________ (a) 24 25 26 27 28 29 30 31 ______________________________________ (b) 6 7 0 0 7 0 0 7 (c) 26 19 20 14 7 14 14 7 (d) 26 19 19.5 14 7 14 14 7 (e) 5.86 7 1 5.5 7 7 0 7 (f) 6 7 7 8 9 10 10 11 ______________________________________ (a) 32 33 34 35 36 37 38 39 ______________________________________ (b) 0 0 7 0 0 7 0 0 (c) 14 14 7 14 14 7 -- -- (d) 14 14 7 14 14 7 -- -- (e) 7 0 7 7 0 7 -- -- (f) 12 12 13 14 14 15 -- -- ______________________________________
In the above Table 1, there are provided columns for the tracing numbers (a), direction codes (b), smoothing codes (c), average values (d), average value differences (e), and linear label numbers (f). The smoothing code (c) is obtained through addition of some direction codes (b) before and after the noticed tracing number (a) and the direction code (b) at the noticed point, and here, the smoothing is effected by five tracing points, including two points before and after the noticed tracing number (referred to as the smoothing of tap numbers 5). The average value (d) is obtained by obtaining the total sum of the smoothing codes (c) of the respective tracing points before the noticed tracing point and judged to be of the same straight line and the smoothing code (c) of the noticed tracing point, and dividing the total sum by the number of the tracing points. The average value difference (e) represents the absolute value of the difference between the average value (d) at the tracing points before the noticed tracing point and the smoothing code (c) at the noticed tracing point. The linear label number (f) intends to form into a group, the tracing points regarded to be the same as a result of the linear judgement, in order to detect the linear component. Subsequently, a method of detecting a linear component "a" in FIG. 3 will be explained with reference to Table 1 referred to above. With respect to the tracing numbers 1 and 2, since part of the data to be smoothed is unknown at this time point, they are to be calculated later when the contour line is in a loop, and neglected when it is not in a loop. Thus, in the first place, a linear label number 1 is given to the tracing number 3. Then, a difference between the smoothing code (c) at the tracing number 4 and the average value of the smoothing codes up to the tracing number 3 is obtained, and when the difference is small, the same linear label number 1 as that for the tracing number 3 is given. Thereafter, in the similar manner as above, provided that there is not a large difference between the average value of the smoothing code (c) in the same linear label number prior to the noticed point and the smoothing code (c) at the noticed point, the same linear label number (f) is imparted, with the noticed point regarded as the same straight line. Specifically, in the above case, when the difference between the average value (d) and the smoothing code (c) is smaller than 1, it is regarded to be of the same straight line.
At the tracing number 12, since the average value difference is 2.33, thus exceeding 1, another linear label number 2 is given and the average value is started to be newly calculated.
If the above result is regarded as the linear component when the number of the same linear label number exceeds a predetermined number, the linear component "a" is to be detected. In the similar manner, the linear component "b" is also detected as the linear label number 5.
The practice as described so far is disclosed, for example, in Japanese Patent Publication Tokkohei No. 2-8347 as a method of separating images according to modes.
In the above conventional method, however, if it is intended to detect the linear component "c" in FIG. 3, in the case where the direction codes are displaced between 0 and 7 as represented by the tracing numbers 27 to 37 in Table 1, the linear component can not be detected, since the correct smoothing code is not obtained due to formation of level difference therein.
Meanwhile, when the smoothing code is to be calculated by software, in order to avoid the problem as described above, there is such a practice that in the presence of displacement between 0 and 7 in the direction code data, the total sum is obtained after addition of the direction code dividing number 8 to the direction codes larger than 0 and smaller than 3, and remainder of dividing thereof by a value obtained through multiplication of the dividing number by the smoothing tap number (40 in the case where the tap number is 5), is used as the smoothing code. However, the above practice also has such disadvantages that the calculating time is increased, and upon realization thereof by hardware, the circuit scale becomes undesirably large.
Another main disadvantage inherent in the above practice is such that, in the case where filtering such as smoothing is to be effected by a comparatively large number of taps, correct result can not be obtained in the data in which the direction code turns by more than one round.